home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / network / lattice / portlib.lzh / PORTLIB / IOCTL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-16  |  5.6 KB  |  249 lines

  1. #ifndef    _IOCTL_H
  2. #define _IOCTL_H
  3.  
  4. #ifndef _COMPILER_H
  5. #include <compiler.h>
  6. #endif
  7.  
  8. #include "sockios.h"
  9.  
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14. #define TIOCGETP    (('T'<< 8) | 0)
  15. #define TIOCSETN    (('T'<< 8) | 1)
  16. #define TIOCGETC    (('T'<< 8) | 2)
  17. #define TIOCSETC    (('T'<< 8) | 3)
  18. #define TIOCGLTC    (('T'<< 8) | 4)
  19. #define TIOCSLTC    (('T'<< 8) | 5)
  20. #define TIOCGWINSZ    (('T'<< 8) | 11)
  21. #define TIOCSWINSZ    (('T'<< 8) | 12)
  22.  
  23. #ifdef __MINT__
  24. #define FSTAT        (('F'<< 8) | 0)
  25. #define FIONREAD    (('F'<< 8) | 1)
  26. #define FIONWRITE    (('F'<< 8) | 2)
  27. #define FUTIME        (('F'<< 8) | 3)
  28. #define FTRUNCATE    (('F'<< 8) | 4)
  29. #define TIOCGPGRP    (('T'<< 8) | 6)
  30. #define TIOCSPGRP    (('T'<< 8) | 7)
  31. #define TIOCFLUSH    (('T'<< 8) | 8)
  32. #define TIOCSTOP    (('T'<< 8) | 9)
  33. #define TIOCSTART    (('T'<< 8) | 10)
  34. #define TIOCGXKEY    (('T'<< 8) | 13)
  35. #define TIOCSXKEY    (('T'<< 8) | 14)
  36.  
  37. #define TIOCIBAUD    (('T'<< 8) | 18)
  38. #define TIOCOBAUD    (('T'<< 8) | 19)
  39. #define TIOCCBRK    (('T'<< 8) | 20)
  40. #define TIOCSBRK    (('T'<< 8) | 21)
  41. #define TIOCGFLAGS    (('T'<< 8) | 22)
  42. #define TIOCSFLAGS    (('T'<< 8) | 23)
  43. #define TIOCOUTQ    (('T'<< 8) | 24)
  44. #define TIOCSETP    (('T'<< 8) | 25)
  45. #define TIOCHPCL    (('T'<< 8) | 26)
  46. #define TIOCCAR        (('T'<< 8) | 27)
  47. #define TIOCNCAR    (('T'<< 8) | 28)
  48. #define TIOCWONLINE    (('T'<< 8) | 29)
  49. #define TIOCSFLAGSB    (('T'<< 8) | 30)
  50. #define TIOCGSTATE    (('T'<< 8) | 31)
  51. #define TIOCSSTATEB    (('T'<< 8) | 32)
  52. #define TIOCGVMIN    (('T'<< 8) | 33)
  53. #define TIOCSVMIN    (('T'<< 8) | 34)
  54.  
  55. /* faked by the library */
  56. #define TIOCMGET    (('T'<< 8) | 248)
  57. #define TIOCCDTR    (('T'<< 8) | 249)
  58. #define TIOCSDTR    (('T'<< 8) | 250)
  59. #define TIOCNOTTY    (('T'<< 8) | 251)
  60.  
  61. /* bits in longword fetched by TIOCMGET */
  62. #define TIOCM_LE    0001 /* not supported */
  63. #define TIOCM_DTR    0002
  64. #define TIOCM_RTS    0004
  65. #define TIOCM_ST    0010 /* not supported */
  66. #define TIOCM_SR    0020 /* not supported */
  67. #define TIOCM_CTS    0040
  68. #define TIOCM_CAR    0100
  69. #define TIOCM_CD    TIOCM_CAR
  70. #define TIOCM_RNG    0200
  71. #define TIOCM_RI    TIOCM_RNG
  72. #define TIOCM_DSR    0400 /* not supported */
  73.  
  74. /* not yet implemented in MiNT */
  75. #define TIOCGETD    (('T'<< 8) | 252)
  76. #define TIOCSETD    (('T'<< 8) | 253)
  77. #define TIOCLGET    (('T'<< 8) | 254)
  78. #define TIOCLSET    (('T'<< 8) | 255)
  79.  
  80. #define NTTYDISC    1
  81.  
  82. /* ioctl's to act on processes */
  83. #define PPROCADDR    (('P'<< 8) | 1)
  84. #define PBASEADDR    (('P'<< 8) | 2)
  85. #define PCTXTSIZE    (('P'<< 8) | 3)
  86. #define PSETFLAGS    (('P'<< 8) | 4)
  87. #define PGETFLAGS    (('P'<< 8) | 5)
  88. #define PTRACESFLAGS    (('P'<< 8) | 6)
  89. #define PTRACEGFLAGS    (('P'<< 8) | 7)
  90. #    define    P_ENABLE    (1 << 0)    /* enable tracing */
  91. #if 0 /* NOTYETDEFINED */
  92. #    define    P_DOS        (1 << 1)    /* trace DOS calls - unimplemented */
  93. #    define    P_BIOS        (1 << 2)    /* trace BIOS calls - unimplemented */
  94. #    define    P_XBIOS        (1 << 3)    /* trace XBIOS calls - unimplemented */
  95. #endif
  96.  
  97. #define PTRACEGO    (('P'<< 8) | 8)    /* these 4 must be together */
  98. #define PTRACEFLOW    (('P'<< 8) | 9)
  99. #define PTRACESTEP    (('P'<< 8) | 10)
  100. #define PTRACE11    (('P'<< 8) | 11)
  101. #define PLOADINFO    (('P'<< 8) | 12)
  102. #define    PFSTAT        (('P'<< 8) | 13)
  103.  
  104. struct __ploadinfo {
  105.     /* passed */
  106.     short fnamelen;
  107.     /* returned */
  108.     char *cmdlin, *fname;
  109. };
  110.  
  111. /* shared memory ioctl's */
  112. #define SHMGETBLK    (('M'<< 8) | 0)
  113. #define SHMSETBLK    (('M'<< 8) | 1)
  114.  
  115. /* cursor control ioctl's */
  116. #define TCURSOFF    (('c'<< 8) | 0)
  117. #define TCURSON        (('c'<< 8) | 1)
  118. #define TCURSBLINK    (('c'<< 8) | 2)
  119. #define TCURSSTEADY    (('c'<< 8) | 3)
  120. #define TCURSSRATE    (('c'<< 8) | 4)
  121. #define TCURSGRATE    (('c'<< 8) | 5)
  122. #endif /* __MINT__ */
  123.  
  124. #ifndef _filesys_h
  125. struct tchars {
  126.     char    t_intrc;
  127.     char    t_quitc;
  128.     char    t_startc;
  129.     char    t_stopc;
  130.     char    t_eofc;
  131.     char    t_brkc;
  132. };
  133.  
  134. struct ltchars {
  135.     char    t_suspc;
  136.     char    t_dsuspc;
  137.     char    t_rprntc;
  138.     char    t_flushc;
  139.     char    t_werasc;
  140.     char    t_lnextc;
  141. };
  142.  
  143. #define    CRMOD        0x0001
  144. #define    CBREAK        0x0002
  145. #ifndef _TERMIOS_H
  146. #define ECHO        0x0004
  147. #endif /* _TERMIOS_H */
  148. #define    XTABS        0x0008
  149. #define    RAW        0x0010
  150. #define LCASE        0x0020        /* does nothing */
  151. #ifndef _TERMIOS_H
  152. #define NOFLSH        0x0040
  153. #ifdef __MINT__
  154. #define TOSTOP        0x0100
  155. #define ECHOCTL        0x0400
  156. #endif /* __MINT__ */
  157. #endif /* _TERMIOS_H */
  158. #define TANDEM        0x1000
  159. #define _RTSCTS        0x2000
  160. #define EVENP        0x4000
  161. #define ODDP        0x8000
  162. #define ANYP        (0)
  163. #endif /* _filesys_h */
  164.  
  165. #ifndef _TERMIOS_H
  166. #define B0        0
  167. #define B50        1
  168. #define B75        2
  169. #define B110        3
  170. #define B134        4
  171. #define B135        4
  172. #define B150        5
  173. #define B200        6
  174. #define B300        7
  175. #define B600        8
  176. #define B1200        9
  177. #define B1800        10
  178. #define B2400        11
  179. #define B4800        12
  180. #define B9600        13
  181. #define B19200        14
  182. #define B38400        15
  183. #endif
  184.  
  185. /* The ones below aren't supported by the kernel, at least not yet */
  186. #define VTDELAY        0
  187. #define ALLDELAY    0
  188.  
  189. #ifdef __MINT__
  190.  
  191. #define XKEY        0x0200
  192.  
  193. #ifndef _filesys_h
  194. struct xkey {
  195.     short    xk_num;
  196.     char    xk_def[8];
  197. };
  198. #endif
  199.  
  200. /* some fake defines for the line discipline stuff */
  201.  
  202. #define LCRTBS        0x01
  203. #define LCRTERA        0x02
  204. #define LCRTKIL        0x04
  205. #define LPRTERA        0x10
  206. #define LFLUSHO        0x20
  207. #define LLITOUT        0x100
  208.  
  209. #else
  210.  
  211. #define META        0x0100        /* extension: Alternate as meta key */
  212. #define PASS8        0x0100
  213.  
  214. #endif /* __MINT__ */
  215.  
  216. #ifndef _filesys_h
  217. struct sgttyb {
  218.     char    sg_ispeed;
  219.     char    sg_ospeed;
  220.     char    sg_erase;
  221.     char    sg_kill;
  222.     short    sg_flags;
  223. };
  224.  
  225. struct winsize {
  226.     short    ws_row;
  227.     short    ws_col;
  228.     short    ws_xpixel;
  229.     short    ws_ypixel;
  230. };
  231. #endif
  232.  
  233. struct _mutimbuf {
  234.     unsigned short actime, acdate;    /* GEMDOS format */
  235.     unsigned short modtime, moddate;
  236. };
  237.  
  238. #define ioctl        _ioctl
  239.  
  240. __EXTERN int _ioctl    __PROTO((int, int, void *));
  241. __EXTERN int stty    __PROTO((int, struct sgttyb *));
  242. __EXTERN int gtty    __PROTO((int, struct sgttyb *));
  243.  
  244. #ifdef __cplusplus
  245. }
  246. #endif
  247.  
  248. #endif    /* _IOCTL_H */
  249.